using System;
using CookComputing.XmlRpc;
using Whitemice.MOGI;

namespace Whitemice.MOGI.ZOGI
{
	public class Address : Whitemice.MOGI.IAddress
	{		
		Payload	payload;
		
		public Address(Payload payload)
		{
			this.payload = payload;
		}
		
		public string Name
		{
			get 
			{ 
				return "Fragment/" + payload.GetStringForKey("entityName") + "/" +
					payload.GetIntForKey("objectId").ToString();
			}
		}
		
		public string TypeAbbreviation 
		{ 
			get { return payload.GetStringForKey("type"); }
		}
		
		public string Name1 
		{ 
			get { return payload.GetStringForKey("name1"); } 
			set { payload.SetValueForKey("name1", value); }
		}
		
		public string Name2 
		{ 
			get { return payload.GetStringForKey("name2"); } 
			set { payload.SetValueForKey("name2", value); }
		}
		
		public string Name3 
		{ 
			get { return payload.GetStringForKey("name3"); } 
			set { payload.SetValueForKey("name3", value); }
		}
		
		public string Street 
		{ 
			get { return payload.GetStringForKey("street"); } 
			set { payload.SetValueForKey("street", value); }
		}
		
		public string City 
		{ 
			get { return payload.GetStringForKey("city"); } 
			set { payload.SetValueForKey("city", value); }
		}
		
		public string State 
		{ 
			get { return payload.GetStringForKey("state"); } 
			set { payload.SetValueForKey("state", value); }
		}
		
		public string Zip 
		{ 
			get { return payload.GetStringForKey("zip"); } 
			set { payload.SetValueForKey("zip", value); }
		}
		
		public string Country 
		{ 
			get { return payload.GetStringForKey("country"); } 
			set { payload.SetValueForKey("country", value); }
		}
	}
}